import express from 'express';
import controller from './controller';
import { authorizeHandlerNormal, authorizeHandleAdmin } from '../../middlewares/authorize';

// 定义路由，使用鉴权中间件
export default express.Router()
  .get('/category/get', authorizeHandlerNormal, controller.get)
  .post('/category/add', authorizeHandleAdmin, controller.add)
  .post('/category/update', authorizeHandleAdmin, controller.update)
  .post('/add', authorizeHandleAdmin, controller.goodsAdd)
  .post('/update',authorizeHandleAdmin,controller.goodsUpdate)
  .post('/delete',authorizeHandleAdmin,controller.goodsDelete)
  .get('/get',authorizeHandlerNormal,controller.goodsGet)
  .get('/list/get',authorizeHandlerNormal,controller.goodsListGet)
  .get('/list/search',authorizeHandlerNormal,controller.goodsListSearch)

